Conversation
|
I think there are a lot of things to consider here. I like the idea of trying to make things more general and reusable but it also adds complexity
There may be some middle ground here that allows us to share commonalities between server pages but im not sure what that is yet |
|
A middle ground might be to keep the curent per-page DTO but extract a small shared server identity/common-fields object (server type, resource group, address, last contact) then each page can use that shared data to create its own explicit row DTO. On the front end, we could do something similar where we keep the columns explicitly defined but reuse small helpers for the common columns. That gives us real reuse where the overlap exists without making the table shape harder to reason about |
True. I initially had the column mapping information in the Metric.java class, but figured someone might object to Monitor related code being there. It doesn't matter to me where it lives.
One of the issues I was trying to solve with this PR is that the current pages are mainly a translation of the pages from 2.1 and 4.0 added many more metrics that we can't visualize during the development cycle to determine which columns should be included in the tables.
I don't have an issue with the current DTO approach, except that it's currently limiting what is being shown in the table. If we added all of the metrics to the current DTOs so that we could determine which columns to include, that would be another approach. Additionally, I'll add that currently the changes in this PR only affect the Scan Server page, but I think it could be a general way to present the metrics for all of the server pages under the Servers menu in the NavBar. There are a couple of problems with the current approach:
This approach allows us to display all of the metrics during development so that we can determine which ones make sense (I noticed immediately that the tablet recovery metrics don't make sense for scan servers). The Monitor calls |
I think some overlap could be removed by pushing the description and type into
Can we just do a pattern of performing a per-table transform/filter before rending the table contents? Will that be enough to make local page-specific or table-specific choices and still be able to reuse the generic code for rending the table from the transformed contents? |
Not having to modify the DataTables JS code if we add/remove a column is definitely a convenience in this approach, but we still have to make the decision to include the new metric in the subset of those shown on the page somewhere. In this approach, it's in
I don't think we actually want most of those to be shown. During development, while we are deciding what is useful to show, it's definitely convenient to see more with less work, but as we work to finalize things, we really should be focused on presentation of the useful things, and avoid turning the monitor into a big tabular display of metrics (a proper metrics collection service should provide that kind of thing instead, whereas the monitor should be focused system deployment status, i.e. "which deployed system components are running and what are they doing right now?").
Is that |
The Monitor is currently the only thing using that endpoint. The Monitor fetching the metrics from the server processes via this method is what is going to enable us to evenutally remove the ManagerMonitorInfo and related code from the Manager. |
|
I'm thinking there are at least 3 ways we could structure things generally
To me frontend defined seems best. Others opinions or ideas would help |
|
One issue, for me at least, is that I'm not a UI developer and I don't have to modify the Monitor front-end code very often. There is no documentation on how it works generally and what things in the various files need to be modified to make a simple change. Every time I have had to modify the Monitor front-end code it's days of re-learning how it works to do something simple. If I never had to touch the Monitor UI code again it would be ok with me. Unfortunately, that's not realistic. For those reasons I would lean toward a more generic front-end solution that doesn't require a modification every time a column needs to be added or removed from a table. I understand your comments and viewpoints when looking at it from the perspective of someone with more experience doing UI development. I'm more concerned with the time it takes to modify the Monitor than anything else really. As for this PR, my main goal is to see all the possible data in the tables during the development of 4.0 so that we can determine which columns belong and which ones don't. In the end I don't really care which approach is taken to achieve that goal except for my comments above about the maintenance burden. |
|
I am fine with backend-defined. Here is what I am thinking might work well (might be similar to what you have here)
The JSON shape to the front end might end up being something like: {
"columns": [
{ "key": "server", "label": "Server", "type": "string" },
{ "key": "resourceGroup", "label": "Resource Group", "type": "string" },
{ "key": "lastContact", "label": "Last Contact", "type": "timestamp" },
{ "key": "accumulo.scan.start", "label": "Scan Start Count", "type": "number" }
],
"rows": [
{
"server": "localhost:1234",
"resourceGroup": "default",
"lastContact": 1712151000000,
"accumulo.scan.start": 42
},
],
"status": { whatever info we might need for the status indicators }
}Like I said I think this PR shares a lot of the same ideas and intent. I just wanted to express what I was thinking in case it differs and might be helpful. |
|
Overall this seems like a good concept to me. Tried running cce9b3e locally and it would not build because of changes to accumulo access. To get around the build problem, cherry picked e9cc35a locally and then it built. When I looked at the rest endpoint {
"data": [
{
"Last Contact": 1775490009993,
"Resource Group": "default",
"Server Address": "localhost:9700",
"Server Type": "SCAN_SERVER"
}
],
"columns": [
{
"name": "Last Contact",
"description": "Server last contact time",
"uiClass": "timestamp"
},
{
"name": "Resource Group",
"description": "Resource Group",
"uiClass": ""
},
{
"name": "Server Address",
"description": "Server address",
"uiClass": ""
},
{
"name": "Server Type",
"description": "Type of server",
"uiClass": ""
}
],
"status": {
"hasScanServers": true,
"hasProblemScanServers": false,
"hasMissingMetrics": false,
"scanServerCount": 1,
"problemScanServerCount": 0,
"missingMetricServerCount": 0,
"level": "OK",
"message": null
},
"timestamp": 1775490012993
}We do not need to display the server type column of scan server on the scan server page.
@DomGarguilo, the json you suggested seems a bit more generic and feels like it would work w/ a wide range of tables to display. Seems like it might be a good improvement. Would we be able to have a single javascript function that all code could use to take this generic json and create a HTML table? Wondering what this will look like on the UI side to make it work. What is the display intent of the json status section in the UI? Like how should it be displayed relative to the table of data? When looking at the scan server page I did not see this data displayed. |
| var storedColumns = getStoredColumns(); | ||
| $.each(storedColumns, function (index, col) { | ||
| //console.log('Adding column: ' + JSON.stringify(col)); | ||
| var th = $(document.createElement("th")); |
There was a problem hiding this comment.
This seems like its manually building HTML in javascript instead of using datatables? Does this mean we lose features of data tables like sorting, search, and pagination? Or this still using datatables? I looked that the monitor page for scan servers w/ these changes and it seems to still have sorting, but I only had a single scan server so not sure if its still working.
There was a problem hiding this comment.
The intent of this PR is to make the monitor page dynamic and responsive to the columns that are returned by the server. No functionality is lost here that I know of, but the HTML columns for the table are created in the javascript instead of the .ftl file. If you turn metrics on, you'll see about 3 dozen metrics coming back from the Scan Server. There are maybe about 1 dozen metrics shown in the UI today.
There was a problem hiding this comment.
No functionality is lost here that I know of, but the HTML columns for the table are created in the javascript instead of the .ftl file.
Ah ok, that was very helpful to know.
If you turn metrics on, you'll see about 3 dozen metrics coming back from the Scan Server.
I did not try that, I will give that a try and see what it looks like.
There was a problem hiding this comment.
I did not try that, I will give that a try and see what it looks like.
Well, it currently looks terrible, but there is a good bit of information available to display on the Monitor that we aren't currently displaying. That's the point of this change, discovering what information is available to the Monitor so that we can decide what to display and what not to display.
Replaced ScanServerView with a generic ServersView object
which contains the column definitions and the data for each
server.